package com.xinnet.core.aop;

import org.springframework.aop.framework.AopContext;

/**
 * 
 * 解决spring事物自我调用不走代理的问题
 * @author 颜绿水
 * @author $Author:$
 * @version $Revision:$ $Date:$ 
 * @since 2014-6-16
 *
 */
public abstract class InjectBeanSelfProcessor implements BeanSelfAware{
	
	private Object proxyBean = null;
	
	@Override
	public Object getProxy() {
		
		if (proxyBean == null) {
			proxyBean = AopContext.currentProxy();
		}
		return proxyBean;
	}

	@Override
	public void setProxy(Object proxyBean) {
		
		this.proxyBean = proxyBean;
	}
}
